<span id="load" url="<?=image_url('load_bar.gif');?>"></span>
<div class="panel">
<div class="row">
	<div class="large-4 columns">
		<div class="btn-group">
			<a href="<?=site_url('teacher/my_classes');?>" class="confirm btn btn-success"title="are you sure you want to exit from grade creator?">Exit</a>
			<a href="<?=site_url('teacher/advisory_input_grades/'.$hash);?>" class="btn btn-primary">Grades <i class="icon-g-table icon-g-white"></i></a>
			<a href="<?=site_url('teacher/advisory_input_attendance/'.$hash);?>" class="btn btn-primary">Attendance <i class="icon-g-calendar icon-g-white"></i></a>
			<a href="<?=site_url('teacher/advisory_input_remarks/'.$hash);?>" class="btn">Remarks <i class="icon-comment icon-black"></i></a>
		</div>
	</div>
	<div class="large-4 columns">
	<?if(isset($section_desc)):?>
		<?if($section_desc):?>
			<?$sec = current($section_desc);?>
			<span style="font-weight:bold;font-size:16px;">Section Name:&nbsp;&nbsp;<?=$sec->section_name;?>,</span>
			<span style="font-weight:bold;font-size:16px;">Grade Level:&nbsp;&nbsp;<?=$sec->level_desc;?></span>
		<?endif;?>
	<?endif;?>
	</div>
	<div class="large-4 columns">
		<label>Go to Section</label>
		<?=form_dropdown('sections',$sections,set_value('sections',$hash),'style="width:200px;display:inline-block;" class="redirect-auto" url="'.$current_url.'"');?>
	</div>
</div>
</div>
<?if($section_exists):?>
<table class="table table-bordered table-striped">
	<tbody>
			
		<tr class="success">
			<td colspan="<?=count($gp) + 1;?>" style="font-weight:bold;">Remarks</td>
		</tr>
		<tr class="success">
			<?if($gp):?>
					<td>&nbsp;</td>
				<?foreach($gp as $k => $v):?>
					<td><strong><?=ucwords($v->gp_desc);?></strong></td>
				<?endforeach;?>
			<?else:?>
				<td colspan="5">-- Grading Periods --</td>
			<?endif;?>
		</tr>
		<?if($remarks):?>
			<?foreach($remarks as $rem):?>
				<tr>
					<td>
						<p style="padding:0;margin:0;font-weight:bold;"><?=$rem['fullname'];?></p>
						<p style="padding:0;margin:0;"><span class="label success"><?=$rem['section_name'];?></span></p>
						<p style="padding:0;margin:0;"><span class="label info">Age:<?=age($rem['dob']);?></span></p>
					</td>
					<?if($rem['remarks']):?>
						<?foreach($rem['remarks'] as $v):?>
							<td>
								<span class="loading"></span>
								<textarea class="ajax-change" url="<?=site_url('output/advisory_remarks/'.__link($v->id));?>" style="max-width:224px;min-width:217px;max-height:120px;min-height:120px;resize: none;padding:5px;font-size:14px;" orgval="<?=trim(html_entity_decode($v->remarks));?>"><?=trim(html_entity_decode($v->remarks));?></textarea>
							</td>
						<?endforeach;?>
					<?else:?>
						<td colspan="<?=count($gp);?>" style="text-align:center;">No Remarks found <a href="<?=site_url('teacher/generate_remark/'.__link($rem['enrollment_id']).'/'.$hash);?>" class="btn btn-mini dsec">generate</a></td>
					<?endif;?>
				</tr>
			<?endforeach;?>
		<?else:?>
			<tr>
				<td colspan="5">No Students</td>
			</tr>
		<?endif;?>
	</tbody>
</table>
<script src="<?=script_url('custom/studentremarks');?>" type="text/javascript"></script>
<?else:?>
	<div class="alert-box secondary">
		Please Select A Section.
	</div>
<?endif;?>